package com.dc.enums;

/**
 * @description: TODO 海湾报警枚举对应
 * @date: 2022/11/02 09:28
 * @Author: zhang
 **/
public enum HaiWanAlarmDesc {

    /**
     * 正常
     */
    HAI_WAN_ALARM_00(0, "正常"),
    /**
     * 故障
     */
    HAI_WAN_ALARM_01(1, "故障"),
    /**
     * 监管
     */
    HAI_WAN_ALARM_02(2, "监管"),
    /**
     * 启动
     */
    HAI_WAN_ALARM_06(6, "启动"),
    /**
     * 报警
     */
    HAI_WAN_ALARM_04(4, "火警");
    /**
     * 状态编码
     */
    private int code;

    /**
     * 状态描述信息
     */
    private String value;

    HaiWanAlarmDesc(int code, String value) {
        this.code = code;
        this.value = value;
    }

    /**
     * 根据code 获取对应得 状态
     *
     * @param code
     * @return
     */
    public static String getValues(int code) {
        for (HaiWanAlarmDesc value : values()) {
            if (value.code == code) {
                return value.value;
            }
        }
        return null;
    }

    public int getCode() {
        return code;
    }

    public String getValue() {
        return value;
    }
}
